#############################
## BLIS/Swayable: Figure 5 ##
#############################

# File Description: 
# Uses data/packages from O_Data.R
# Replicates Figure 5 from Fabric of Repair report (2025)
# Date Last Updated: 2 May 2025

#############################

# Regression model stratified by race for Land Back support
land_back_support <- lm(Land.Back.Support ~ treatment*race + video_perception, df)

# Regression model stratified by race for Reparations support
reparations_support <- lm(Reparations.Support ~ treatment*race + video_perception, df)

# Predictions by race for Land Back support
lb_preds <- ggpredict(land_back_support, terms = c("treatment", "race")) %>%
  mutate(outcome = "Land Back")

# Predictions by race for Reparations support
r_preds <- ggpredict(reparations_support, terms = c("treatment", "race")) %>%
  mutate(outcome = "Reparations")

# Merging predictions
support_preds <- rbind(lb_preds, r_preds)

# Plotting Figure 5
support_preds %>%
  ggplot(aes(x = x, y = predicted, fill = outcome)) +
  geom_col(position = "dodge") +
  geom_errorbar(aes(ymin = conf.low, ymax = conf.high), position=position_dodge(.9), width=.2) +
  labs(x = "Video", y = "Average Support", fill = "Movement", caption = "Note: Perceived production quality control added.") +
  facet_wrap(~group) +
  scale_fill_manual(values = c("#1DA595", "#F94B01")) +
  theme_bw() +
  labs(title = "Movement Support Among Black & Indigenous Audiences") + 
  scale_y_continuous(limits = c(0, 10), breaks = c(0, 2.5, 5, 7.5, 10), 
                     labels = c("0, Definitely No", "2.5", "5", "7.5", "10, Definitely Yes"))
